﻿// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.RemoteCryptoSignHashRequest
// Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 8E14765A-6610-409A-BA36-099A0642905D
// Assembly location: E:\git\ALLIDA\windll\infocard.exe

using System.IO;

namespace Microsoft.InfoCards
{
  internal class RemoteCryptoSignHashRequest : RpcCryptoRequest
  {
    private byte[] m_signature;
    private byte[] m_hash;
    private int m_hashType;
    private int m_flags;

    public RemoteCryptoSignHashRequest(
      RpcCryptoContext context,
      int hashType,
      int flags,
      byte[] hash)
      : base(context)
    {
      this.m_hash = hash;
      this.m_hashType = hashType;
      this.m_flags = flags;
    }

    public override string Name
    {
      get
      {
        return "RpcCryptoSignHashRequest";
      }
    }

    public byte[] GetSignature()
    {
      return this.m_signature;
    }

    protected override void MarshalOutArgs(Stream stream)
    {
      BinaryWriter binaryWriter = new BinaryWriter(stream);
      binaryWriter.Write(this.m_hashType);
      binaryWriter.Write(this.m_flags);
      binaryWriter.Write(this.m_hash.Length);
      binaryWriter.Write(this.m_hash, 0, this.m_hash.Length);
    }

    protected override void MarshalReturnArgs(Stream stream)
    {
      BinaryReader binaryReader = (BinaryReader) new InfoCardBinaryReader(stream);
      this.m_signature = binaryReader.ReadBytes(binaryReader.ReadInt32());
    }
  }
}
